<?php

class Friend extends CI_Controller{
function add_friend($id1,$id2){
$q="insert into koneksi (`user1`,`user2`,`status`) values ('$id1','$id2','0')";
$result= $this->db->simple_query($q);
return $result;
}
function response_ok($id1,$id2){
$q= " update koneksi SET `status`='1' where `user1`='$id1' and `user2`='$id2'";
$result=$this->db->query($q);
}
function response_no($id1,$id2){
$q= "delete from koneksi where `user1`='$id1' and `user2`='$id2'"; 
$result=$this->db->query($q);
}
function get_friend($id1){
$q="select * from koneksi where `user1`='$id1' or `user2`='$id2' AND `status`='1'";
$result=$this->db->query($q);


}
}